<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Flex布局(一个容器 设置了display:flex属性,就定义了一个flex容器.它的直接===子元素===会接受这个flex环境)</title>
</head>
<style>
  .box {
    width: 1000px;
    height: 200px;
    display: flex; /*一个容器 设置了display:flex属性,就定义了一个flex容器.它的直接===子元素===会接受这个flex环境.*/
    /* flex-wrap: wrap;  一行排列，不行就会换行*/
    /* flex-flow属性是flex-direction属性和flex-wrap属性的简写形式，默认值为row nowrap。 */
    /* justify-content: space-around; 水平居中*/ 
    /* align-items: center;  垂直居中*/
    /* align-content: center; */
  }
  .childBox {
    width: 100px;
    height: 100px;
    background-color: pink; 
  }
</style>
<body>
  <div>注意，设为 Flex 布局以后，子元素的float、clear和vertical-align属性将失效。</div>
  <br/>
  <div class="box">
    <div class="childBox">1</div>
    <div class="childBox">2</div>
    <div class="childBox">3</div>
    <div class="childBox">4</div>
    <div class="childBox">1</div>
    <!-- <div class="childBox">2</div>
    <div class="childBox">3</div>
    <div class="childBox">4</div>
    <div class="childBox">1</div>
    <div class="childBox">2</div>
    <div class="childBox">3</div>
    <div class="childBox">4</div> -->
  </div>
  
</body>
</html>